package Eyjafjalla.action;

import Eyjafjalla.patch.CloudPatch;
import Eyjafjalla.power.RedCloudPower;
import com.megacrit.cardcrawl.actions.AbstractGameAction;
import com.megacrit.cardcrawl.actions.common.ApplyPowerAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.core.Settings;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.monsters.AbstractMonster;

import java.util.ArrayList;

public class TranceAction extends AbstractGameAction {
    public TranceAction(int amt){
        this.amount = amt;
    }

    @Override
    public void update() {
        ArrayList<AbstractGameAction> actions = new ArrayList<>();
        for(AbstractMonster monster:AbstractDungeon.getMonsters().monsters){
            if(!monster.isDeadOrEscaped()){
                actions.add(0,new ApplyPowerAction(monster,AbstractDungeon.player,new RedCloudPower(monster,this.amount),this.amount));
            }
        }
        for(AbstractGameAction action:actions){
            addToTop(action);
        }

        this.isDone = true;
    }
}
